package com.yoyo.itravel.bean;

import org.springframework.stereotype.Repository;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单的实体类
 * liuchaojie
 */
@Table
public class FlightOrder implements Serializable {
    @Id
    @Column(name = "orderId")
    private String orderId;//机票订单id
    @Column(name = "userId")
    private String userId;//订单所属用户id
    @Column(name = "ticketTypeId")
    private String ticketTypeId;//机票类型id
    @Column(name = "orderStatus")
    private Integer orderStatus;//0:已取消、1:待付款、2:待出行、3:已完成、4：已退款
    @Column(name = "payAmount")
    private BigDecimal payAmount;//支付金额
    @Column(name = "payType")
    private Integer payType;//'支付类型(1:支付宝、2:微信)',
    @Column(name = "createTime")
    private Date createTime;//订单生成时间
    @Column(name = "tradeNo")
    private String tradeNo;//交易号

    private List<TravelerInfo> travelerInfos;//一个订单有多个旅客

    @Override
    public String toString() {
        return "FlightOrder{" +
                "orderId='" + orderId + '\'' +
                ", userId='" + userId + '\'' +
                ", ticketTypeId='" + ticketTypeId + '\'' +
                ", orderStatus=" + orderStatus +
                ", payAmount=" + payAmount +
                ", payType=" + payType +
                ", createTime=" + createTime +
                ", tradeNo='" + tradeNo + '\'' +
                ", travelerInfos=" + travelerInfos +
                '}';
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String ticketTypeId() {
        return ticketTypeId;
    }

    public void ticketTypeId(String ticketTypeId) {
        this.ticketTypeId = ticketTypeId;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public String getTicketTypeId() {
        return ticketTypeId;
    }

    public void setTicketTypeId(String ticketTypeId) {
        this.ticketTypeId = ticketTypeId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public List<TravelerInfo> getTravelerInfos() {
        return travelerInfos;
    }

    public void setTravelerInfos(List<TravelerInfo> travelerInfos) {
        this.travelerInfos = travelerInfos;
    }

    public FlightOrder(String orderId, String userId, String ticketTypeId, Integer orderStatus, BigDecimal payAmount, Integer payType, Date createTime, String tradeNo, List<TravelerInfo> travelerInfos) {
        this.orderId = orderId;
        this.userId = userId;
        this.ticketTypeId = ticketTypeId;
        this.orderStatus = orderStatus;
        this.payAmount = payAmount;
        this.payType = payType;
        this.createTime = createTime;
        this.tradeNo = tradeNo;
        this.travelerInfos = travelerInfos;
    }

    public FlightOrder() {
    }
}
